package com.jpaAutoProcess.utils;

import javax.persistence.Parameter;
import javax.persistence.Query;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;



public class SqlUtils {
    public SqlUtils() {
    }

    public static void setParameters(Map<String, Object> parameters, Query query) {
        Set<Parameter<?>> existParams = query.getParameters();
        Iterator var3 = existParams.iterator();

        while(var3.hasNext()) {
            Parameter<?> existParam = (Parameter)var3.next();
            //existParam.getName()这个就是whrer a.name 这个字段属性，parameters.get(existParam.getName())这个是获取要比较的值
            query.setParameter(existParam.getName(), parameters.get(existParam.getName()));
        }

    }
}
